package com.core.model.xg;

import com.core.dto.ExcutorDTO;
import com.core.model.AbstractEntity;

import javax.persistence.*;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * 项目执行者
 *
 * @author lxf
 * @date 2018/5/2 16:52
 * To change this template use Editor | File and Code Templates.
 */
@Entity
@Table(name = "excutor")
public class Excutor extends AbstractEntity {

    private String name;

    @OneToMany(mappedBy = "excutor")
    private List<Refrigeration> refrigerations;

    public Excutor() {
    }

    public Excutor(String name) {
        this.name = name;
    }

    public String name() {
        return name;
    }

    public void init(ExcutorDTO excutorDTO) {
        this.name = excutorDTO.getName();
    }

    public List<Refrigeration> refrigerations() {
        return refrigerations;
    }
}
